from aip import AipFace
import base64
import cv2
import os
import time


""" 你的 APPID AK SK """
APP_ID = '22912073'
API_KEY = '3zbPMNiqWOrsD5BspgX1pBoR'
SECRET_KEY = 'nxSoiCZnSdOV9DVTPhHrlMvAYvTHZNa4'

# aip_face对象
aipFace = AipFace(APP_ID, API_KEY, SECRET_KEY)

groupId = "main"
# userId = "user1"



""" 调用获取用户人脸列表 """
face_root = r'face'
face_imgs = os.listdir(face_root)
for face_img in face_imgs:
    userId = face_img.split()[1]
    result = aipFace.faceGetlist(userId, groupId)
    error_code = result['error_code']
    error_msg = result['error_msg']
    result = result['result']
    face_list = result['face_list']
    print(userId)
    print(result)
    time.sleep(0.5)



